<div data-ng-controller="revenueController">
    <div class="table-header lh30 mt20 clearfix ng-scope">
        <span class="fl lh30 f14">{{title}}</span>

        <span ng-show="revenueType === 'unrecognized' || revenueType === 'recognized'">
            （当前结转期间：
            <span ng-show="!editRecognitionDate">{{recognitionBegin|strdate:'yyyy-MM-dd'}}~{{recognitionEnd|strdate:'yyyy-MM-dd'}}</span>
            <span ng-show="editRecognitionDate">
                <input type="text" class="input-text input-data"
                       ui-date
                       format="yyyy-MM-dd"
                       id="start_date"
                       max-date="#F{$dp.$D(\'end_date'\)}"
                       ng-model="recognitionBeginUI"/>
                ~
                <input type="text" class="input-text input-data"
                       readonly
                       ui-date
                       format="yyyy-MM-dd"
                       id="end_date"
                       min-date="#F{$dp.$D(\'start_date'\)}"
                       ng-model="recognitionEndUI"
                />
            </span>
            ）
        </span>
        <span class="permission p-1602-inline-block" ng-show="revenueType === 'unrecognized'">
            <button class="btn" ng-show="!editRecognitionDate" ng-click="editRecognitionDate=true">修改</button>
            <button class="btn" ng-show="editRecognitionDate" ng-click="setRecognitionDate()">确定</button>
            <button class="btn btn-yellow" ng-show="editRecognitionDate"
                    ng-click="editRecognitionDate=false">取消</button>
        </span>

        <div class="fr btn-group">
            <a
                ng-if="revenueType === 'unrecognized'"
                class="btn permission p-1602-inline-block"
                href="javascript:;"
                ui-dialog="收入结转"
                ui-dialog-template="{{dialogTemplate}}"
                ui-dialog-data="{recognitionSetBy:recognitionSetBy,recognitionDate:recognitionDate}"
                ui-dialog-init="onInitDialog($dialog,$dialogScope)"
            >收入结转</a>
            <a
                class="btn btn-yellow"
                href="javascript:;"
                ng-click="downloadExcel($event)"
            >导出excel</a>
        </div>
    </div>

    <div class="table-responsive mt10">
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="35">序号</th>
                <th ng-repeat="item in cols">{{item.name}}</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="record in list">
                <td>{{($index+1+pageOptions.pageSize*(pageOptions.pageIndex-1))}}</td>
                <td ng-repeat="item in cols" ng-bind-html="item.render ? item.render(record) : record[item.key]"></td>
            </tr>
            </tbody>
        </table>
        <div ng-show="!list || list.length===0" class="no-data"><span>暂无数据</span></div>
    </div>
    <div
        ui-pagination
        page-index="pageOptions.pageIndex"
        total="total"
        page-size="pageOptions.pageSize"
        changed="changePage($pageIndex, $pageSize)"
    ></div>
</div>
